<div class="well" xmlns:th="http://www.thymeleaf.org">

	<h4>New Twitter</h4>

	<form class="form-search" action="#"
		th:action="@{/network/savetwitter}" name="savetwitterform"
		id="savetwitterform" th:object="${socialNetwork}" method="post">

		<!-- 
		<div class="form-actions">
			<button type="submit" class="btn btn-primary">Save</button>
			<button type="button" class="btn">Cancel</button>
		</div>
		 -->

		<div class="alert alert-success" th:if="${socialNetwork.id != null}">
			<strong>Well done!</strong> Twitter details saved successfully.
		</div>


		<fieldset>
			<table style="width: 100%">

				<tr class="control-group" th:class="${#fields.hasErrors('name')} ? 'control-group error' : 'control-group'">
					<td class="inputLabel"><label for="name">Name</label></td>
					<td class="controls">
						<input type="text" th:field="*{name}" required="required" 
							th:disabled="${socialNetwork.id != null}" autofocus="autofocus" class="input span8" placeholder="Name" />
						<span class="help-inline error" th:if="${#fields.hasErrors('name')}"
								th:errors="*{company.name}">Name is required.</span>
					</td>
					
					<td class="inputLabel">
						<label for="sharedSecret">API Key</label>
					</td>
					<td>
						<input type="text" th:field="*{sharedSecret}" 
							disabled="disabled" class="input span8" placeholder="System generated API Key"></input>
					</td>
				
				</tr>

				<tr class="control-group" th:class="${#fields.hasErrors('consumerKey')} or ${#fields.hasErrors('consumerSecret')} ? 'control-group error' : 'control-group'">
					<td class="inputLabel"><label for="name">Consumer Key</label></td>
					<td class="controls">
						<input type="text" th:field="*{consumerKey}" required="required" 
							th:disabled="${socialNetwork.id != null}" autofocus="autofocus" class="input span8" placeholder="Consumer Key" />
						<span class="help-inline error" th:if="${#fields.hasErrors('consumerKey')}"
								th:errors="*{consumerKey}">Name is required.</span>
					</td>

					<td class="inputLabel"><label for="consumerSecret">Consumer
							Secret</label></td>
					<td class="controls">
						<input type="text" th:field="*{consumerSecret}" required="required" 
							th:disabled="${socialNetwork.id !=null}" autofocus="autofocus" class="input span8" placeholder="Consumer Secret" />
						<span class="help-inline error" th:if="${#fields.hasErrors('consumerSecret')}"
								th:errors="*{consumerSecret}">Name is required.</span>
					</td>

				</tr>


				<tr class="control-group" th:class="${#fields.hasErrors('accessToken')} or ${#fields.hasErrors('accessTokenSecret')} ? 'control-group error' : 'control-group'">
					<td class="inputLabel"><label for="accessToken">Access
							Token</label></td>
					<td  class="controls">
								
						<input type="text" th:field="*{accessToken}" required="required" 
							th:disabled="${socialNetwork.id !=null}" autofocus="autofocus" class="input span8" placeholder="Access Token" />
						<span class="help-inline error" th:if="${#fields.hasErrors('accessToken')}"
								th:errors="*{accessToken}">Name is required.</span>
						
					</td>

					<td class="inputLabel"><label for="accessTokenSecret">Access
							Token Secret</label></td>
					<td  class="controls">
						
						<input type="text" th:field="*{accessTokenSecret}" required="required" 
							th:disabled="${socialNetwork.id !=null}" autofocus="autofocus" class="input span8" placeholder="Access Token Secret" />
						<span class="help-inline error" th:if="${#fields.hasErrors('accessTokenSecret')}"
								th:errors="*{accessTokenSecret}">Name is required.</span>
						
					</td>

				</tr>




			</table>
		</fieldset>


		<div class="form-actions">
			<button type="submit" class="btn btn-primary" th:disabled="${socialNetwork.id !=null}">Save</button>
			<button type="button" class="btn" th:disabled="${socialNetwork.id !=null}">Cancel</button>
		</div>

	</form>
</div>

